home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12129 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: solon.com!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c,comp.lang.c.moderated
  4. Subject: Re: const pointer confusion...
  5. Date: 29 Mar 1996 05:55:30 -0600
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Sender: clc@solutions.solon.com
  8. Approved: clc@solutions.solon.com
  9. Message-ID: <4jgj3i$s5q@solutions.solon.com>
  10. References: <4j06gm$7oa@solutions.solon.com> <4j6354$3ge@solutions.solon.com> <4ja3uf$pe8@solutions.solon.com> <4jcklh$9u3@solutions.solon.com>
  11. NNTP-Posting-Host: solutions.solon.com
  12.  
  13. In article <4jcklh$9u3@solutions.solon.com>,
  14. Lawrence Kirby  <fred@genesis.demon.co.uk> wrote:
  15. >Still wrong! :-)
  16. >
  17. >It is a constraint violation which the compiler must diagnose.
  18. >
  19. >6.5.3 constraints:
  20. >
  21. >"The same type qualifier shall not appear more than once in the same
  22. > specifier list or qualifier list, either directly or via one or more
  23. > typedefs."
  24.  
  25. Oops, missed that one. Thus _no_ specifier can appear more than once in the
  26. specifier list, really. Duplicate or contradictory storage classes are clearly
  27. out as are duplicate/contradictory type specifiers.
  28.  
  29. So, concisely written, you can have at most one type qualifier of each kind
  30. (const, volatile), at most one storage class and at most one type specifier, in
  31. whatever order you wish.
  32.  
  33. >>Your compiler is producing a misleading diagnostic. There is no invalid type
  34. >>combination here. The error is one of a redunant ``const'', which is not
  35. >>forbidden by the C language.
  36. >
  37. >The compiler is correct.
  38.  
  39. Amazing! :)
  40.  
  41. My apologies for contributing B.S. to the contrary.
  42. -- 
  43.